<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@include file="/web/header.jsp" %>
<title>首页</title>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">EMPS信息管理系统</div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="">控制台</a></li>
      <li class="layui-nav-item"><a href="">商品管理</a></li>
      <li class="layui-nav-item"><a href="">用户</a></li>
      <li class="layui-nav-item">
        <a href="javascript:;">其它系统</a>
        <dl class="layui-nav-child">
          <dd><a href="">邮件管理</a></dd>
          <dd><a href="">消息管理</a></dd>
          <dd><a href="">授权管理</a></dd>
        </dl>
      </li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="<%=app %>/web/base/img/image.jpg" class="layui-nav-img" >
          [${user.name}]
        </a>
        <dl class="layui-nav-child">
          <dd><a href="javascript:openUpd()">修改资料</a></dd>
          <dd><a href="javascript:openPass()">修改密码</a></dd>
          <dd><a href="javascript:openImage()">修改头像</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="javascript:goLogout()">注销</a></li>
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="javascript:;">信息维护<span class="layui-nav-more"></span></a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:openURL('/web/page/staff/list.jsp');">员工信息维护</a></dd>
            <dd><a href="javascript:;" data-url="/web/page/department/list2.jsp" class="site-demo-active">部门信息维护</a></dd>
            <dd><a href="javascript:;" data-url="/web/page/project/list.jsp" class="site-demo-active">项目信息维护</a></dd>
            <dd><a href="javascript:;" data-url="/web/page/achievements/list.jsp" class="site-demo-active">绩效信息维护</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item layui-nav-itemed">
          <a href="javascript:;">基础配置<span class="layui-nav-more"></span></a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">列表一</a></dd>
            <dd><a href="javascript:;">列表二</a></dd>
            <dd><a href="">超链接</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item"><a href="">云市场</a></li>
        <li class="layui-nav-item"><a href="">发布商品</a></li>
        <span class="layui-nav-bar" style="top: 22.5px; height: 0px; opacity: 0;"></span>
      </ul>
    </div>
  </div>
  
  <div class="layui-body">
    <iframe name = "rightframe" width="99%" height="97%"></iframe><!-- 内容主体区域 -->
  </div>
  
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © JAVA.com - 底部固定区域
  </div>
</div>
<script>
//JavaScript代码区域
element.render();
function goLogout(){
	goJspLogin()
}
function openURL(url){
	window.open(base.app+url,"rightframe");
}
$('.site-demo-active').click(function(){
	window.open(base.app+$(this).data('url'),"rightframe");
});
$('.site-demo-active:first').click();

function goLogout(){
	openConfirm(function(index){
		layer.close(index);
		toJsp("/StaffServlet?action=logout");
	},'确定注销？');
}
initImage();
function initImage(){
	var image = '${user.image}';
	image=image?"/image/"+image:
		base.app+"/web/base/img/image.jpg";
	$('img[class="layui-nav-img"]').attr('src',image)
}
function openUpd(code) {
	openLayer('/web/page/staff/update.jsp?code=${user.code}', refresh)
}
function openPass(code) {
	openLayer('/web/page/staff/updPass.jsp?code=${user.code}', refresh)
}
function openImage(code){
	openLayer('/web/page/staff/updImage.jsp?code=${user.code}', refresh)
}
function refresh(){
	location.reload();
}
</script>
</body>
</html>